<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="author" content="Jxz">
    <title></title>
    <script src="jquery-3.1.1.js"></script>
</head>
<body>
    <div id="test-jquery">
        <p id="para-1" class="color-red">JavaScript</p>
        <p id="para-2" class="color-green">Haskell</p>
        <p class="color-red color-green">Erlang</p>
        <p name="name" class="color-black text">Python</p>
        <form class="test-form" target="_blank" action="#0" onsubmit="return false;">
            <legend>注册新用户</legend>
            <fieldset>
                <p><label>名字:<input name="name"></label></p>
                <p><label>邮件:<input name="email"></label></p>
                <p><label>口令:<input name="password" type="password" class="text"></label></p>
                <p><button type="submit">注册</button></p>
            </fieldset>
        </form>
    </div>
</body>
</html>
<script type="text/javascript">
  /*练习:使用jQuery选择器分别选出指定元素:
    仅选择JavaScript
    仅选择Erlang
    同时选择JavaScript和Erlang
    选择所有 <p>
    选择名字为name的input
    同时选择名字为email和name的input
	*/
    // 1.JavaScript
    var JavaScript=($('#para-1').html());
    // JavaScript=($('#para-1'));
    console.log(JavaScript);
    // 2.Erlang
    // var Erlang=($('#test-jquery>p:nth-child(3)').html());
    var Erlang=($('.color-red.color-green').html());
    // Erlang=($('.color-red.color-green'));
    console.log(Erlang);
     
    //  3.JavaScript和Erlang
    var two=($('p:lt(3).color-red'));
    console.dir(two);

    //  4. 所有 <p>
    var p =($('p'));
    console.dir(p);

    // 5.
    var inputN=($('fieldset>p:first-child>label>input'));
    console.dir(inputN);
    
    // 6.
    // 找到input下 除type=password 剩下的所有元素
    var inputTwo=$('input').not(':password');
    console.dir(inputTwo);
</script>